
import { Injectable } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';


@Injectable()
export class AuthService {
	constructor(
		private readonly jwtService: JwtService,
	) {}

	async createToken(user: any) {
		const payload = {
			date: Date.now(),
			userId: user._id
		};
		return {
			token: this.jwtService.sign(payload),
		};
	}

}
